package ui;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * @author Matthias
 * @author NielsChristianMouritsen
 */
public class AdmMenu extends JPanel {
	
	private final JLabel lbl_Header;
	private final JLabel logo_ATM;
	private final JButton btn_Logout;
	private final JButton btn_CreateUser;
	private final JButton btn_DeleteUser;
	private final JButton btn_ViewUser;
	private final JButton btn_EditUser;
	
	/** Constructor AdmMenu()
	 * Contains the information/blueprint on labels and buttons
	 * Sets the window Dimensions
	 */
	
	public AdmMenu() {
		
		setPreferredSize(new Dimension(600, 480));
		setLayout(null);
		
		lbl_Header = new JLabel("Administrator Menu");
		lbl_Header.setFont(new Font("SansSerif", Font.BOLD, 26));
		lbl_Header.setBounds(180, 41, 249, 34);
		add(lbl_Header);
		
		btn_Logout = new JButton("Logout");
		btn_Logout.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_Logout.setBounds(129, 301, 150, 50);
		add(btn_Logout);
		
		btn_CreateUser = new JButton("Create User");
		btn_CreateUser.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_CreateUser.setBounds(129, 117, 150, 50);
		add(btn_CreateUser);
		
		btn_DeleteUser = new JButton("Delete User");
		btn_DeleteUser.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_DeleteUser.setBounds(335, 117, 150, 50);
		add(btn_DeleteUser);
		
		btn_ViewUser = new JButton("View User");
		btn_ViewUser.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_ViewUser.setBounds(335, 190, 150, 50);
		add(btn_ViewUser);
		
		btn_EditUser = new JButton("Edit User");
		btn_EditUser.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_EditUser.setBounds(129, 190, 150, 50);
		add(btn_EditUser);
		
		logo_ATM = new JLabel("");
		logo_ATM.setIcon(new ImageIcon(AdmMenu.class.getResource("/pic/LOGO Mini.png")));
		logo_ATM.setBounds(15, 15, 50, 50);
		add(logo_ATM);
	}
	
	/**
	 * @return create user button
	 */
	public JButton getCreate(){
		return btn_CreateUser;
	}
	
	/**
	 * @return edit user button
	 */
	public JButton getAdmEdit(){
		return btn_EditUser;
	}
	
	/**
	 * @return delete user button
	 */
	public JButton getDelete(){
		return btn_DeleteUser;
	}
	
	/**
	 * @return view user button
	 */
	public JButton getView(){
		return btn_ViewUser;
	}
	
	/**
	 * @return logout button, logging the admin out
	 */
	public JButton getLogout(){
		return btn_Logout;
	}
	
	/**
	 * @return edit user button
	 */
	public JButton getEdit(){
		return btn_EditUser;
	}
	
	/** Adds action listeners
	 * @param event
	 */
	public void addActionListener(final ActionListener event) {
		btn_Logout.addActionListener(event);
		btn_CreateUser.addActionListener(event);
		btn_DeleteUser.addActionListener(event);
		btn_ViewUser.addActionListener(event);
		btn_EditUser.addActionListener(event);
	}
	
} // end this class